<?php
class ReporterAction extends HomeAction{
    //新闻列表
    public function show(){
		$rs=D("Home.News");$arr=$rs->where('news_del=0 and news_id='.$vid)->find();//$rs->find($vid);
		$this->display('reporter_show');
    }
	//新闻内容
    public function read(){
		$vid=$_GET['id'];
		$pid=$_GET['p']?intval($_GET['p']):1;
		$rs=D("Home.News");$arr=$rs->where('news_del=0 and news_id='.$vid)->find();//$rs->find($vid);
		if($arr){
			Vendor('News.Page');    
			$CP=new cutpage();
			$CP->pagestr=$arr['news_content'];
			$CP->cut_custom="{nextpage}";//手动分页标签
			$CP->page_word=5000;
			$CP->cut_tag=array("</table>", "</div>", "</p>", "<br/>", "</img>", "”。", "。", ".", "！", "……", "？", ",");//自动分页截取尾部的标记
			$CP->ipage=$pid;
			$CP->url=ppvodurl('news/read',array('id'=>$vid)).'-p-{!page!}'.C('url_html_suffix');
			$CP->cut_str();
			$arr['news_content']=$CP->pagearr[$pid-1];//分页后的内容
			$list=list_search(F('_ppvod/list'),'list_id='.$arr['news_cid']);
			$this->assign($list[0]);
			$this->assign($arr);
			$this->assign('page',$CP->show_prv_next());
			$this->assign('pplist',A("Home.News"));
			$this->assign('title',$arr['news_name'].'-'.C('site_name').C('site_by'));
			$this->display('pp_news');
		}else{
			$this->error('暂无数据，请谅解！');
		}
    }
	//ajax调用浏览数
    public function ajaxhot(){
		$id=$_GET['id'];
		if($id){
		    $rs=D("Home.News");
			$rs->setInc('news_hits','news_id='.$id);
		    $arr=$rs->field('news_hits')->find($id);
			echo("document.write('".$arr['news_hits']."');");
		}
    }
	//js自定义调用
    public function script(){
		$id=trim($_GET['id']);
		$this->assign('pplist',A("Home.Vod"));
		$this->display('pp_'.$id);
	}
	//iframe自定义调用
    public function iframe(){
		$id=trim($_GET['id']);
		$this->assign('pplist',A("Home.Vod"));
		$this->display('pp_'.$id);
	}								
}
?>